3.78 \(\int \sqrt {a+a \cos (c+d x)} (A+B \cos (c+d x)) \sec (c+d x) \, dx\)

Optimal. Leaf size=66 \[ \frac {2 \sqrt {a} A \tanh ^{-1}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {a \cos (c+d x)+a}}\right )}{d}+\frac {2 a B \sin (c+d x)}{d \sqrt {a \cos (c+d x)+a}} \]

[Out]

2*A*arctanh(sin(d*x+c)*a^(1/2)/(a+a*cos(d*x+c))^(1/2))*a^(1/2)/d+2*a*B*sin(d*x+c)/d/(a+a*cos(d*x+c))^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.14, antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {2981, 2773, 206} \[ \frac {2 \sqrt {a} A \tanh ^{-1}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {a \cos (c+d x)+a}}\right )}{d}+\frac {2 a B \sin (c+d x)}{d \sqrt {a \cos (c+d x)+a}} \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[a + a*Cos[c + d*x]]*(A + B*Cos[c + d*x])*Sec[c + d*x],x]

[Out]

(2*Sqrt[a]*A*ArcTanh[(Sqrt[a]*Sin[c + d*x])/Sqrt[a + a*Cos[c + d*x]]])/d + (2*a*B*Sin[c + d*x])/(d*Sqrt[a + a*
Cos[c + d*x]])

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 2773

Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[(-2*
b)/f, Subst[Int[1/(b*c + a*d - d*x^2), x], x, (b*Cos[e + f*x])/Sqrt[a + b*Sin[e + f*x]]], x] /; FreeQ[{a, b, c
, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]

Rule 2981

Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.
) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(-2*b*B*Cos[e + f*x]*(c + d*Sin[e + f*x])^(n + 1))/(d*f*(2*n + 3)*Sqr
t[a + b*Sin[e + f*x]]), x] + Dist[(A*b*d*(2*n + 3) - B*(b*c - 2*a*d*(n + 1)))/(b*d*(2*n + 3)), Int[Sqrt[a + b*
Sin[e + f*x]]*(c + d*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] &&
EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] &&  !LtQ[n, -1]

Rubi steps

\begin {align*} \int \sqrt {a+a \cos (c+d x)} (A+B \cos (c+d x)) \sec (c+d x) \, dx &=\frac {2 a B \sin (c+d x)}{d \sqrt {a+a \cos (c+d x)}}+A \int \sqrt {a+a \cos (c+d x)} \sec (c+d x) \, dx\\ &=\frac {2 a B \sin (c+d x)}{d \sqrt {a+a \cos (c+d x)}}-\frac {(2 a A) \operatorname {Subst}\left (\int \frac {1}{a-x^2} \, dx,x,-\frac {a \sin (c+d x)}{\sqrt {a+a \cos (c+d x)}}\right )}{d}\\ &=\frac {2 \sqrt {a} A \tanh ^{-1}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {a+a \cos (c+d x)}}\right )}{d}+\frac {2 a B \sin (c+d x)}{d \sqrt {a+a \cos (c+d x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.10, size = 66, normalized size = 1.00 \[ \frac {\sec \left (\frac {1}{2} (c+d x)\right ) \sqrt {a (\cos (c+d x)+1)} \left (\sqrt {2} A \tanh ^{-1}\left (\sqrt {2} \sin \left (\frac {1}{2} (c+d x)\right )\right )+2 B \sin \left (\frac {1}{2} (c+d x)\right )\right )}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a + a*Cos[c + d*x]]*(A + B*Cos[c + d*x])*Sec[c + d*x],x]

[Out]

(Sqrt[a*(1 + Cos[c + d*x])]*Sec[(c + d*x)/2]*(Sqrt[2]*A*ArcTanh[Sqrt[2]*Sin[(c + d*x)/2]] + 2*B*Sin[(c + d*x)/
2]))/d

________________________________________________________________________________________

fricas [B]  time = 0.66, size = 127, normalized size = 1.92 \[ \frac {{\left (A \cos \left (d x + c\right ) + A\right )} \sqrt {a} \log \left (\frac {a \cos \left (d x + c\right )^{3} - 7 \, a \cos \left (d x + c\right )^{2} - 4 \, \sqrt {a \cos \left (d x + c\right ) + a} \sqrt {a} {\left (\cos \left (d x + c\right ) - 2\right )} \sin \left (d x + c\right ) + 8 \, a}{\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2}}\right ) + 4 \, \sqrt {a \cos \left (d x + c\right ) + a} B \sin \left (d x + c\right )}{2 \, {\left (d \cos \left (d x + c\right ) + d\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cos(d*x+c))^(1/2)*(A+B*cos(d*x+c))*sec(d*x+c),x, algorithm="fricas")

[Out]

1/2*((A*cos(d*x + c) + A)*sqrt(a)*log((a*cos(d*x + c)^3 - 7*a*cos(d*x + c)^2 - 4*sqrt(a*cos(d*x + c) + a)*sqrt
(a)*(cos(d*x + c) - 2)*sin(d*x + c) + 8*a)/(cos(d*x + c)^3 + cos(d*x + c)^2)) + 4*sqrt(a*cos(d*x + c) + a)*B*s
in(d*x + c))/(d*cos(d*x + c) + d)

________________________________________________________________________________________

giac [B]  time = 15.59, size = 1884, normalized size = 28.55 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cos(d*x+c))^(1/2)*(A+B*cos(d*x+c))*sec(d*x+c),x, algorithm="giac")

[Out]

1/2*sqrt(2)*sqrt(a)*(sqrt(2)*(A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^3*tan(1/4*c)^6 - 6*A*sgn(cos(1/2*d*x + 1/
2*c))*tan(1/2*c)^3*tan(1/4*c)^5 + 3*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^2*tan(1/4*c)^6 - 15*A*sgn(cos(1/2*d
*x + 1/2*c))*tan(1/2*c)^3*tan(1/4*c)^4 + 18*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^2*tan(1/4*c)^5 - 3*A*sgn(co
s(1/2*d*x + 1/2*c))*tan(1/2*c)*tan(1/4*c)^6 + 20*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^3*tan(1/4*c)^3 - 45*A*
sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^2*tan(1/4*c)^4 + 18*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)*tan(1/4*c)^5 -
 A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/4*c)^6 + 15*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^3*tan(1/4*c)^2 - 60*A*sg
n(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^2*tan(1/4*c)^3 + 45*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)*tan(1/4*c)^4 - 6
*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/4*c)^5 - 6*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^3*tan(1/4*c) + 45*A*sgn(c
os(1/2*d*x + 1/2*c))*tan(1/2*c)^2*tan(1/4*c)^2 - 60*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)*tan(1/4*c)^3 + 15*A
*sgn(cos(1/2*d*x + 1/2*c))*tan(1/4*c)^4 - A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^3 + 18*A*sgn(cos(1/2*d*x + 1/
2*c))*tan(1/2*c)^2*tan(1/4*c) - 45*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)*tan(1/4*c)^2 + 20*A*sgn(cos(1/2*d*x
+ 1/2*c))*tan(1/4*c)^3 - 3*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^2 + 18*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c
)*tan(1/4*c) - 15*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/4*c)^2 + 3*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c) - 6*A*sg
n(cos(1/2*d*x + 1/2*c))*tan(1/4*c) + A*sgn(cos(1/2*d*x + 1/2*c)))*log(abs(-2*tan(1/4*d*x + c)*tan(1/2*c)^3 + 6
*tan(1/4*d*x + c)*tan(1/2*c)^2 - 2*tan(1/2*c)^3 - 2*sqrt(2)*(tan(1/2*c)^2 + 1)^(3/2) + 6*tan(1/4*d*x + c)*tan(
1/2*c) - 6*tan(1/2*c)^2 - 2*tan(1/4*d*x + c) + 6*tan(1/2*c) + 2)/abs(-2*tan(1/4*d*x + c)*tan(1/2*c)^3 + 6*tan(
1/4*d*x + c)*tan(1/2*c)^2 - 2*tan(1/2*c)^3 + 2*sqrt(2)*(tan(1/2*c)^2 + 1)^(3/2) + 6*tan(1/4*d*x + c)*tan(1/2*c
) - 6*tan(1/2*c)^2 - 2*tan(1/4*d*x + c) + 6*tan(1/2*c) + 2))/((tan(1/4*c)^6 + 3*tan(1/4*c)^4 + 3*tan(1/4*c)^2
+ 1)*(tan(1/2*c)^2 + 1)^(3/2)) + sqrt(2)*(A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^3*tan(1/4*c)^6 + 6*A*sgn(cos(
1/2*d*x + 1/2*c))*tan(1/2*c)^3*tan(1/4*c)^5 - 3*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^2*tan(1/4*c)^6 - 15*A*s
gn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^3*tan(1/4*c)^4 + 18*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^2*tan(1/4*c)^5
- 3*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)*tan(1/4*c)^6 - 20*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^3*tan(1/4*
c)^3 + 45*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^2*tan(1/4*c)^4 - 18*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)*ta
n(1/4*c)^5 + A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/4*c)^6 + 15*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^3*tan(1/4*c)
^2 - 60*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^2*tan(1/4*c)^3 + 45*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)*tan(
1/4*c)^4 - 6*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/4*c)^5 + 6*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^3*tan(1/4*c)
- 45*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^2*tan(1/4*c)^2 + 60*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)*tan(1/4
*c)^3 - 15*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/4*c)^4 - A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^3 + 18*A*sgn(cos(
1/2*d*x + 1/2*c))*tan(1/2*c)^2*tan(1/4*c) - 45*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)*tan(1/4*c)^2 + 20*A*sgn(
cos(1/2*d*x + 1/2*c))*tan(1/4*c)^3 + 3*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2*c)^2 - 18*A*sgn(cos(1/2*d*x + 1/2*c
))*tan(1/2*c)*tan(1/4*c) + 15*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/4*c)^2 + 3*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/2
*c) - 6*A*sgn(cos(1/2*d*x + 1/2*c))*tan(1/4*c) - A*sgn(cos(1/2*d*x + 1/2*c)))*log(abs(-2*tan(1/4*d*x + c)*tan(
1/2*c)^3 - 6*tan(1/4*d*x + c)*tan(1/2*c)^2 + 2*tan(1/2*c)^3 - 2*sqrt(2)*(tan(1/2*c)^2 + 1)^(3/2) + 6*tan(1/4*d
*x + c)*tan(1/2*c) - 6*tan(1/2*c)^2 + 2*tan(1/4*d*x + c) - 6*tan(1/2*c) + 2)/abs(-2*tan(1/4*d*x + c)*tan(1/2*c
)^3 - 6*tan(1/4*d*x + c)*tan(1/2*c)^2 + 2*tan(1/2*c)^3 + 2*sqrt(2)*(tan(1/2*c)^2 + 1)^(3/2) + 6*tan(1/4*d*x +
c)*tan(1/2*c) - 6*tan(1/2*c)^2 + 2*tan(1/4*d*x + c) - 6*tan(1/2*c) + 2))/((tan(1/4*c)^6 + 3*tan(1/4*c)^4 + 3*t
an(1/4*c)^2 + 1)*(tan(1/2*c)^2 + 1)^(3/2)) - 8*(B*sgn(cos(1/2*d*x + 1/2*c))*tan(1/4*d*x + c)*tan(1/4*c)^6 - 15
*B*sgn(cos(1/2*d*x + 1/2*c))*tan(1/4*d*x + c)*tan(1/4*c)^4 + 6*B*sgn(cos(1/2*d*x + 1/2*c))*tan(1/4*c)^5 + 15*B
*sgn(cos(1/2*d*x + 1/2*c))*tan(1/4*d*x + c)*tan(1/4*c)^2 - 20*B*sgn(cos(1/2*d*x + 1/2*c))*tan(1/4*c)^3 - B*sgn
(cos(1/2*d*x + 1/2*c))*tan(1/4*d*x + c) + 6*B*sgn(cos(1/2*d*x + 1/2*c))*tan(1/4*c))/((tan(1/4*c)^6 + 3*tan(1/4
*c)^4 + 3*tan(1/4*c)^2 + 1)*(tan(1/4*d*x + c)^2 + 1)))/d

________________________________________________________________________________________

maple [B]  time = 1.16, size = 210, normalized size = 3.18 \[ \frac {\cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (A \ln \left (\frac {4 \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {a}+4 a \sqrt {2}\, \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+8 a}{2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\sqrt {2}}\right ) a +A \ln \left (-\frac {4 \left (\sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {a}-a \sqrt {2}\, \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+2 a \right )}{-2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\sqrt {2}}\right ) a +2 B \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {a}\right )}{\sqrt {a}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*cos(d*x+c))^(1/2)*(A+B*cos(d*x+c))*sec(d*x+c),x)

[Out]

1/a^(1/2)*cos(1/2*d*x+1/2*c)*(a*sin(1/2*d*x+1/2*c)^2)^(1/2)*(A*ln(4/(2*cos(1/2*d*x+1/2*c)+2^(1/2))*(2^(1/2)*(a
*sin(1/2*d*x+1/2*c)^2)^(1/2)*a^(1/2)+a*2^(1/2)*cos(1/2*d*x+1/2*c)+2*a))*a+A*ln(-4/(-2*cos(1/2*d*x+1/2*c)+2^(1/
2))*(2^(1/2)*(a*sin(1/2*d*x+1/2*c)^2)^(1/2)*a^(1/2)-a*2^(1/2)*cos(1/2*d*x+1/2*c)+2*a))*a+2*B*2^(1/2)*(a*sin(1/
2*d*x+1/2*c)^2)^(1/2)*a^(1/2))/sin(1/2*d*x+1/2*c)/(a*cos(1/2*d*x+1/2*c)^2)^(1/2)/d

________________________________________________________________________________________

maxima [A]  time = 0.61, size = 21, normalized size = 0.32 \[ \frac {2 \, \sqrt {2} B \sqrt {a} \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cos(d*x+c))^(1/2)*(A+B*cos(d*x+c))*sec(d*x+c),x, algorithm="maxima")

[Out]

2*sqrt(2)*B*sqrt(a)*sin(1/2*d*x + 1/2*c)/d

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.02 \[ \int \frac {\left (A+B\,\cos \left (c+d\,x\right )\right )\,\sqrt {a+a\,\cos \left (c+d\,x\right )}}{\cos \left (c+d\,x\right )} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2))/cos(c + d*x),x)

[Out]

int(((A + B*cos(c + d*x))*(a + a*cos(c + d*x))^(1/2))/cos(c + d*x), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \sqrt {a \left (\cos {\left (c + d x \right )} + 1\right )} \left (A + B \cos {\left (c + d x \right )}\right ) \sec {\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cos(d*x+c))**(1/2)*(A+B*cos(d*x+c))*sec(d*x+c),x)

[Out]

Integral(sqrt(a*(cos(c + d*x) + 1))*(A + B*cos(c + d*x))*sec(c + d*x), x)

________________________________________________________________________________________